/*
 * Copyright (c) 2011, Nikolaus Moll
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * * Neither the name of the gradecalculator.net nor the
 *   names of its contributors may be used to endorse or promote products
 *   derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */
package net.gradecalculator.plugin.core.stux.internal;

import java.util.HashMap;
import java.util.Map;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import net.gradecalculator.plugin.core.stux.internal.adapters.XmlGradeAdapter;

@XmlRootElement(namespace = "http://gradecalculator.net/", name="examinationResult")
@XmlType( 
 name="examinationResult",
 propOrder = { "courseIdentifier", "examNumber", "grades", "ungradedPassed", "courseDescription", "semester" } 
) 
public class XmlExaminationResult {
	private String courseIdentifier = "";
	private int examNumber = 0;
	private Map<String, String> grades = new HashMap<String, String>();
	private boolean ungradedPassed;
	private boolean isEstimated;
	private int semester;

	private XmlCourseDescription courseDescription = null;

	@XmlTransient 
	public boolean isEstimated() {
		return isEstimated;
	}
	public void setEstimated(final boolean isEstimated) {
		this.isEstimated = isEstimated;
	}

	@XmlElement(name = "ungradedpassed") 
	public boolean getUngradedPassed() {
		return ungradedPassed;
	}
	public void setUngradedPassed(final boolean ungradedPassed) {
		this.ungradedPassed = ungradedPassed;
	}
	
	@XmlElement(name = "grades") 
	@XmlJavaTypeAdapter(XmlGradeAdapter.class)
	public Map<String, String> getGrades() {
		return grades;
	}
	public void setGrades(final Map<String, String> grades) {
		this.grades = grades;
	}

	@XmlElement(name = "courseidentifier") 
	public String getCourseIdentifier() {
		return courseIdentifier;
	}
	public void setCourseIdentifier(final String courseIdentifier) {
		this.courseIdentifier = courseIdentifier;
	}

	@XmlElement(name = "examnumber") 
	public int getExamNumber() {
		return examNumber;
	}
	public void setExamNumber(final int examNumber) {
		this.examNumber = examNumber;
	}

	@XmlElement(name = "coursedescription") 
	public XmlCourseDescription getCourseDescription() {
		return courseDescription;
	}
	public void setCourseDescription(final XmlCourseDescription courseDescription) {
		this.courseDescription = courseDescription;
	}
	
	@XmlElement(name = "semester") 
	public int getSemester() {
		return semester;
	}
	public void setSemester(final int semester) {
		this.semester = semester;
	}

}
